home *** CD-ROM | disk | FTP | other *** search
- Public Class frmDiscInfo
- Inherits System.Windows.Forms.Form
- Public frm As Form1
-
- #Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
-
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents cdUsedSpaceLbl As System.Windows.Forms.Label
- Friend WithEvents cdStatusLbl As System.Windows.Forms.Label
- Friend WithEvents cdTypeLbl As System.Windows.Forms.Label
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents cdEstUsedSpaceLbl As System.Windows.Forms.Label
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents RefreshBtn As System.Windows.Forms.Button
- Friend WithEvents EjectBtn As System.Windows.Forms.Button
- Friend WithEvents OKBtn As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox()
- Me.cdEstUsedSpaceLbl = New System.Windows.Forms.Label()
- Me.Label5 = New System.Windows.Forms.Label()
- Me.cdUsedSpaceLbl = New System.Windows.Forms.Label()
- Me.cdStatusLbl = New System.Windows.Forms.Label()
- Me.cdTypeLbl = New System.Windows.Forms.Label()
- Me.Label3 = New System.Windows.Forms.Label()
- Me.Label2 = New System.Windows.Forms.Label()
- Me.Label1 = New System.Windows.Forms.Label()
- Me.RefreshBtn = New System.Windows.Forms.Button()
- Me.EjectBtn = New System.Windows.Forms.Button()
- Me.OKBtn = New System.Windows.Forms.Button()
- Me.GroupBox1.SuspendLayout()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cdEstUsedSpaceLbl, Me.Label5, Me.cdUsedSpaceLbl, Me.cdStatusLbl, Me.cdTypeLbl, Me.Label3, Me.Label2, Me.Label1})
- Me.GroupBox1.Location = New System.Drawing.Point(3, 8)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(337, 126)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- Me.GroupBox1.Text = "Disc Total"
- '
- 'cdEstUsedSpaceLbl
- '
- Me.cdEstUsedSpaceLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
- Me.cdEstUsedSpaceLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
- Me.cdEstUsedSpaceLbl.Location = New System.Drawing.Point(134, 97)
- Me.cdEstUsedSpaceLbl.Name = "cdEstUsedSpaceLbl"
- Me.cdEstUsedSpaceLbl.Size = New System.Drawing.Size(191, 18)
- Me.cdEstUsedSpaceLbl.TabIndex = 13
- Me.cdEstUsedSpaceLbl.Text = "0"
- Me.cdEstUsedSpaceLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label5
- '
- Me.Label5.Location = New System.Drawing.Point(14, 99)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(104, 15)
- Me.Label5.TabIndex = 12
- Me.Label5.Text = "Est. Space:"
- '
- 'cdUsedSpaceLbl
- '
- Me.cdUsedSpaceLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
- Me.cdUsedSpaceLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
- Me.cdUsedSpaceLbl.Location = New System.Drawing.Point(134, 73)
- Me.cdUsedSpaceLbl.Name = "cdUsedSpaceLbl"
- Me.cdUsedSpaceLbl.Size = New System.Drawing.Size(191, 18)
- Me.cdUsedSpaceLbl.TabIndex = 11
- Me.cdUsedSpaceLbl.Text = "0"
- Me.cdUsedSpaceLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'cdStatusLbl
- '
- Me.cdStatusLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
- Me.cdStatusLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
- Me.cdStatusLbl.Location = New System.Drawing.Point(134, 49)
- Me.cdStatusLbl.Name = "cdStatusLbl"
- Me.cdStatusLbl.Size = New System.Drawing.Size(191, 18)
- Me.cdStatusLbl.TabIndex = 10
- Me.cdStatusLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'cdTypeLbl
- '
- Me.cdTypeLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
- Me.cdTypeLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
- Me.cdTypeLbl.Location = New System.Drawing.Point(134, 26)
- Me.cdTypeLbl.Name = "cdTypeLbl"
- Me.cdTypeLbl.Size = New System.Drawing.Size(192, 18)
- Me.cdTypeLbl.TabIndex = 9
- Me.cdTypeLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label3
- '
- Me.Label3.Location = New System.Drawing.Point(14, 76)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(104, 15)
- Me.Label3.TabIndex = 8
- Me.Label3.Text = "Used Space:"
- '
- 'Label2
- '
- Me.Label2.Location = New System.Drawing.Point(14, 52)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(104, 15)
- Me.Label2.TabIndex = 7
- Me.Label2.Text = "Status:"
- '
- 'Label1
- '
- Me.Label1.Location = New System.Drawing.Point(14, 29)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(104, 15)
- Me.Label1.TabIndex = 6
- Me.Label1.Text = "Type:"
- '
- 'RefreshBtn
- '
- Me.RefreshBtn.Location = New System.Drawing.Point(352, 12)
- Me.RefreshBtn.Name = "RefreshBtn"
- Me.RefreshBtn.Size = New System.Drawing.Size(105, 18)
- Me.RefreshBtn.TabIndex = 1
- Me.RefreshBtn.Text = "Refresh"
- '
- 'EjectBtn
- '
- Me.EjectBtn.Location = New System.Drawing.Point(351, 37)
- Me.EjectBtn.Name = "EjectBtn"
- Me.EjectBtn.Size = New System.Drawing.Size(105, 18)
- Me.EjectBtn.TabIndex = 3
- Me.EjectBtn.Text = "Eject"
- '
- 'OKBtn
- '
- Me.OKBtn.Location = New System.Drawing.Point(350, 116)
- Me.OKBtn.Name = "OKBtn"
- Me.OKBtn.Size = New System.Drawing.Size(105, 18)
- Me.OKBtn.TabIndex = 4
- Me.OKBtn.Text = "OK"
- '
- 'frmDiscInfo
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
- Me.ClientSize = New System.Drawing.Size(459, 144)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.OKBtn, Me.EjectBtn, Me.RefreshBtn, Me.GroupBox1})
- Me.MaximizeBox = False
- Me.MinimizeBox = False
- Me.Name = "frmDiscInfo"
- Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
- Me.Text = "frmDiscInfo"
- Me.GroupBox1.ResumeLayout(False)
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
-
- Private Sub frmDiscInfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- frm = Me.Owner
- RefreshFormData()
- End Sub
- Private Sub RefreshFormData()
- frm.RefreshDiskInfo()
-
- cdUsedSpaceLbl.Text = Format((frm.DataCDWriter1.cdUsedSpace / 1024) / 1024, "#0.000") & " MB"
- cdEstUsedSpaceLbl.Text = Format((frm.DataCDWriter1.GetDataVolumeBurnSize / 1024) / 1024, "#0.000") & " MB"
-
- Select Case frm.DataCDWriter1.cdType
- Case NCTDISCWRITERLib.CD_TYPE.WRITEONCE
- cdTypeLbl.Text = "CD-R, CD-ROM"
- EjectBtn.Enabled = True
-
- Case NCTDISCWRITERLib.CD_TYPE.ERASABLE
- cdTypeLbl.Text = "CD-RW"
- EjectBtn.Enabled = True
-
-
- Case NCTDISCWRITERLib.CD_TYPE.RANDOMACCESS
- cdTypeLbl.Text = "DVD-RAM"
- EjectBtn.Enabled = True
-
- Case NCTDISCWRITERLib.CD_TYPE.NODISC
- cdTypeLbl.Text = "No Disc"
- EjectBtn.Enabled = False
- cdUsedSpaceLbl.Text = "0"
-
- End Select
-
- Select Case frm.DataCDWriter1.cdStatus
- Case NCTDISCWRITERLib.CD_STATUS.BLANK
- cdStatusLbl.Text = "Blank"
- cdUsedSpaceLbl.Text = "0"
- Case NCTDISCWRITERLib.CD_STATUS.WRITEBLE
- cdStatusLbl.Text = "Open"
- Case NCTDISCWRITERLib.CD_STATUS.NOTWRITEBLE
- cdStatusLbl.Text = "Closed"
- Case NCTDISCWRITERLib.CD_STATUS.UNRECOGNIZED
- cdStatusLbl.Text = "Unknown"
- cdUsedSpaceLbl.Text = "0"
- End Select
- End Sub
-
- Private Sub RefreshBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshBtn.Click
- RefreshFormData()
- End Sub
-
- Private Sub EjectBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EjectBtn.Click
- frm.DataCDWriter1.Eject()
- frm.RefreshDiskInfo()
- RefreshFormData()
- End Sub
-
- Private Sub OKBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKBtn.Click
- Me.Hide()
- End Sub
- End Class
-